<?php
class Make_code_model extends CI_Model
{
    private $table = 'make_code';
    
    public function findByLastId()
    {
        $this->db->order_by('id', 'DESC');
        $this->db->limit(1);
        return $this->db->get($this->table);
    }
    
    public function insertMakeCode($makeCode)
    {
        $this->db->insert($this->table, array('code'=>$makeCode));
        return $this->db->insert_id();
    }
}